CREATE EXTERNAL TABLE IF NOT EXISTS spmi_ods.spmi_cod_global_bill(
id                                                 bigint                         COMMENT '主键ID',
waybill_no                                         String                         COMMENT '运单编号',
bill_generation_time                               timestamp                      COMMENT '账单产生时间',
bill_generation_date                               String                         COMMENT '账单产生日期',
send_financial_center_id                           bigint                         COMMENT '寄件财务中心ID',
send_financial_center_name                         String                         COMMENT '寄件财务中心名称',
send_financial_center_code                         String                         COMMENT '寄件财务中心CODE',
fee_type_id                                        bigint                         COMMENT '费用类型ID',
fee_type_name                                      String                         COMMENT '费用类型名称',
send_network_id                                    bigint                         COMMENT '寄件网点ID',
send_network_code                                  String                         COMMENT '寄件网点编码',
send_network_name                                  String                         COMMENT '寄件网点名称',
fee_type_code                                      String                         COMMENT '费用类型编码',
create_time                                        timestamp                      COMMENT '创建时间',
update_time                                        timestamp                      COMMENT '更新时间',
piece_financial_center_id                          bigint                         COMMENT '派件财务中心',
piece_financial_center_name                        String                         COMMENT '派件财务中心名称',
piece_financial_center_code                        String                         COMMENT '派件财务中心编码',
piece_network_id                                   bigint                         COMMENT '派件网点ID',
piece_network_code                                 String                         COMMENT '派件网点编码',
piece_network_name                                 String                         COMMENT '派件网点名称'
)
COMMENT '全局表'
PARTITIONED BY (dt STRING COMMENT '更新/创建日期 (yyyy-MM-dd)')
STORED AS PARQUET
LOCATION '/dw/hive/spmi_ods.db/external/spmi_cod_global_bill'
TBLPROPERTIES (
  'parquet.column.index.access'='true'
);